package org.example.huawei;

/**
 * @author: lynn
 * @Descript:
 * @date: 2022/2/9 21:40
 * @version: 1.0
 */
public class SwaggerTwo {

    private  static final  Object o=new Object();

    private  static char[] nu="123".toCharArray();
    private  static char[] ku="ABC".toCharArray();

    public static void main(String[] args) {

        new Thread(()->{
           synchronized(o){
               for(char c:ku){
                   try {
                       System.out.print(c);
                       o.notify();
                       o.wait();
                   } catch (InterruptedException e) {
                       e.printStackTrace();
                   }
               }
           }
        }).start();


        new Thread(()->{
            synchronized(o){
                for(char c:nu){
                    try {
                        System.out.print(c);
                        o.notify();
                        o.wait();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }).start();





    }
}
